package com.masterclient.app.modules.income.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;
import android.view.ViewGroup;

import java.util.List;

public class MyPagerAdapter extends FragmentStatePagerAdapter {
    String[] titles;
    private List<Fragment> list;
    public MyPagerAdapter(FragmentManager fm, List<Fragment> list,String[] titles) {
        super(fm);
        this.list = list;
        this.titles = titles;

    }
    @Override
    public CharSequence getPageTitle(int position) {
        return titles[position];//页卡标题
    }

    @Override
    public int getCount() {
        return list.size();
    }

    @Override
    public Fragment getItem(int arg0) {
        return list.get(arg0);
    }
    @Override
    public Object instantiateItem(ViewGroup arg0, int arg1) {

        return super.instantiateItem(arg0, arg1);
    }
    @Override
    public void destroyItem(ViewGroup container, int position, Object object) {
        super.destroyItem(container, position, object);
    }
}
